﻿using System.Numerics;
using WaveSim.Core.Equations.Galerkin;

namespace MicroWave
{
    public class Sphere : BaseDielectric
    {
        public Sphere()
        {
        }

        public double X0 { get; set; }

        public double Z0 { get; set; }

        public double Radius { get; set; }

        public double ReEps { get; set; }

        public double ImEps { get; set; }

        /// <summary>
        /// Returns a value of epsilon
        /// </summary>
        /// <param name="coordinate">x and z values</param>
        /// <returns></returns>
        public override Complex Eps(params double[] coordinate)
        {
            double x = coordinate[0];
            double z = coordinate[1];
            x = x - X0;
            z = z - Z0;
            if (x * x + z * z <= Radius * Radius)
            {
                return new Complex(ReEps, ImEps);
            }
            return DefaultValue;
        }

        /// <summary>
        /// Returns a value of mu
        /// </summary>
        /// <param name="coordinate">x and z values</param>
        /// <returns></returns>
        public override Complex Mu(params double[] coordinate)
        {
            return DefaultValue;
        }
    }
}
